import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import index from './views/index.vue'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/index',
      name: 'index',
      component: index
    },
    {
      path: '/login',
      name: 'login',
      component:()=>import('./views/login.vue')
    },
    {
      path: '/book',
      name: 'book',
      component:()=>import('./views/Bookkeep.vue')
    },
    {
      path: '/flow',
      name: 'flow',
      component:()=>import('./views/PocketBook/flow.vue')
    },
    {
      path: '/',
      name: 'charts',
      component:()=>import('./views/PocketBook/charts.vue')
    },
    {
      path: '/groupManage',
      name: 'groupManage',
      component:()=>import('./views/PocketBook/groupManage.vue')
    },
    {
      path: '/newmemo',
      name: 'newmemo',
      component:()=>import('./memo/newMemo.vue')
    },
    {
      path: '/allmemo',
      name: 'allmemo',
      component:()=>import('./memo/allMemo.vue')
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ]
})

// 导航守卫
// 使用 router.beforeEach 注册一个全局前置守卫，判断用户是否登陆


